home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / Chip_2004-11_cd1.bin / zkuste / dolby / download / dvdlab / DVDlabProRC2b.exe / {app} / Extras / Script / Object Blur.talk < prev    next >
Text File  |  2004-03-22  |  2KB  |  56 lines

  1. /*    Object Blur 1.0
  2.     by Oscar, 11 Dec 2003
  3.     
  4.     To run this: DROP the Script from Assets to the Object in Menu.
  5.     
  6.     Note: because of the bitmap merging, the text will become not-editable after you apply this
  7. */
  8.  
  9. // Get the current menu and selected object when you drag and drop script
  10. // Note: if testing from Script editor make sure you have just one menu opened on desktop,
  11. //       in such case the MenuGetCurSel will return currently opened menu 
  12. menu = MenuGetCurSel() 
  13. // VTS menu 1..255, VMG menu 10001..10255 
  14.  
  15. // show the current menu on top of all others
  16. MenuActivate(menu)
  17.  
  18. object= ObjectGetCurSel(menu) 
  19.  
  20. if (object==0) then
  21.     print "No object Selected"
  22.     end
  23. endif
  24.  
  25. //newObject = ObjectCopy(menu,object,menu) 
  26. //object = newObject
  27.  
  28. blur = 50
  29.  
  30. //get the image buffer from object and store it in buffer 1
  31. ImgGrabObject(1,menu,object) // imgNum = temporary image buffer 1,2 or 3
  32.  
  33. //remember the current object size and position
  34. x = ObjectGetXPos(menu,object) 
  35. y = ObjectGetYPos(menu,object) 
  36. nW = ObjectGetWidth(menu,object)
  37. nH = ObjectGetHeight(menu,object)
  38.  
  39. inflate = blur/3
  40. infHalf = inflate/2
  41. // inflate the image (not object) 30 on each side so the blur has enough space
  42. ImgInflate(1,inflate,inflate)
  43.  
  44. // blur alpha and rgb
  45. ImgBlurAlpha(1,blur)
  46. ImgBlur(1,blur)
  47.  
  48. // all objects will be converted to bitmap objects (text will be no more editable)
  49. ImgSetToObject(1,menu,object)
  50.  
  51. // resize the object itself and shift it so it is centered to original
  52. ObjectSetSize(menu,object,nW+inflate,nH+inflate)
  53. ObjectSetPos(menu,object,x-infHalf,y-infHalf)
  54.  
  55.